package mapper;

import DO.WorkJudgeDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WorkJudgeMapper {
    // 保存测试信息
    void save(WorkJudgeDO workJudgeDO);

    @Select("select * from work_judge where work_id=#{workId} order by `order`")
    List<WorkJudgeDO> getByWorkId(Integer workId);

    // 获取判断题分值
    @Select("select score from work_judge where `order` = 1 and work_id = #{workId}")
    Double getScoreByWorkId(Integer workId);

    @Select("select count(*) from work_judge where judge_id = #{id}")
    Integer getIsrelevancyWork(Integer id);
}
